<?php

//删除博文

include __DIR__ . '/../../inc/conn.php';
include __DIR__ . '/../../inc/checkSesion.php';


$delId = intval($_POST['delId']);

$sqlCheck = "SELECT id FROM blog_info WHERE id=$delId";
$res = mysqli_query($conn, $sqlCheck);

if (!($rwt =mysqli_fetch_array($res))) {
    echo 'error';
}

$sqlDel = "DELETE FROM blog_info WHERE id=$delId";
$res = mysqli_query($conn, $sqlDel);

if (!$res) {
    echo 'error';
}

echo 'ok';